import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'home',
            component: () => import('../components/Layout.vue'),
            children: [
                {
                    path: 'guards',
                    name: 'guards',
                    component: () => import('../view/guards/Guards.vue'),
                    children: [
                        {
                            path: 'dashboard',
                            name: 'dashboard',
                            component: () => import('../view/guards/dashboard/Dashboard.vue'),
                        },
                        {
                            path: 'host',
                            name: 'host',
                            component: () => import('../view/guards/host/Host.vue'),
                        },
                        {
                            path: 'monitor',
                            name: 'monitor',
                            component: () => import('../view/guards/monitor/Monitor.vue'),
                        },
                        {
                            path: 'alarm',
                            name: 'alarm',
                            component: () => import('../view/guards/alarm/Alarm.vue'),
                        },
                        {
                            path: 'item',
                            name: 'item',
                            component: () => import('../view/guards/item/Item.vue'),
                        },
                    ]
                },
                {
                    path: 'manage',
                    name: 'manage',
                    component: () => import('../view/manage/Manage.vue'),
                    children: [
                        {
                            path: 'account',
                            name: 'account',
                            component: () => import('../view/manage/account/Account.vue'),
                        },
                        {
                            path: 'org',
                            name: 'org',
                            component: () => import('../view/manage/org/Org.vue'),
                        },
                        {
                            path: 'role',
                            name: 'role',
                            component: () => import('../view/manage/role/Role.vue'),
                        },
                        {
                            path: 'view',
                            name: 'view',
                            component: () => import('../view/manage/view/View.vue'),
                        },
                        {
                            path: 'permission',
                            name: 'permission',
                            component: () => import('../view/manage/permission/Permission.vue'),
                        },
                        {
                            path: 'dict',
                            name: 'dict',
                            component: () => import('../view/manage/dict/Dict.vue'),
                        },
                        {
                            path: 'message',
                            name: 'message',
                            component: () => import('../view/manage/message/Message.vue'),
                        },
                        {
                            path: 'account_message',
                            name: 'account_message',
                            component: () => import('../view/manage/message/AccountMessage.vue'),
                        },
                        {
                            path: 'audit_log',
                            name: 'audit_log',
                            component: () => import('../view/manage/log/AuditLog.vue'),
                        },
                        {
                            path: 'parameter',
                            name: 'parameter',
                            component: () => import('../view/manage/parameter/Parameter.vue'),
                        },
                    ]
                },
            ]
        },
        {
            path: '/login',
            name: 'login',
            component: () => import('../view/login/Login.vue')
        },
        {
            path: '/about',
            name: 'about',
            // route level code-splitting
            // this generates a separate chunk (About.[hash].js) for this route
            // which is lazy-loaded when the route is visited.
            component: () => import('../components/HelloWorld1.vue')
        }
    ]
})

export default router
